<template>
  <j-select-biz-component
    :multiple='multiple' :width="1000" :name="name" :buttons='buttons' :inputs="inputs" :queryConfig='queryConfig' :searchIcon='searchIcon' :selectButtonText="selectButtonText"
    v-on="$listeners"
    v-bind="configs"
  />
</template>

<script>
import JSelectBizComponent from './JSelectBizComponent'

export default {
  name: 'JSelectRole',
  components: { JSelectBizComponent },
  props: {
    value: {
      type: String,
      default: ''
    },
    name: {
      type: String,
      default: '角色'
    },
    selectButtonText:{
      type: String,
      default: '选择'
    },
    inputs:{
      type: Boolean,
      default: true
    },
    searchIcon:{
      type: String,
      default: 'search'
    },
    queryConfig:{
      type:Array,
      default:()=>[
        {
          label: '角色编号',
          key: 'roleCode'
        },
      ]
    },
    listUrl:{
      type:String,
      default: '/cnRoleController/getRoleList',
    },
    multiple:{
      type: Boolean,
      default: true
    },
    buttons:{
      type:Boolean,
      default:true
    },
    returnName:{
      type:Boolean,
      default:false
    },
  },
  data() {
    return {
      settings: {
        displayKey: 'roleName',
        returnKeys: ['id', 'roleCode'],
        rowKey: 'roleCode',
        queryParamCode: 'roleName',
        queryParamText: '角色名称',
        columns: [
          { title: '角色名称', field: 'roleName', align: 'center', minWidth: 120 },
          { title: '角色编号', field: 'roleCode', align: 'center', minWidth: 120 }
        ]
      }
    }
  },
  computed: {
    configs() {
      return Object.assign({ value: this.value ,listUrl: this.listUrl,returnName:this.returnName}, this.settings, this.$attrs)
    }
  }
}
</script>

<style lang="less" scoped></style>
